#!/usr/bin/env perl
#
# $URL: svn+ssh://vistabella.de/pub/svn/tools/trunk/asmcalls $
#
# This script reads "objdump -a" output (from stdin or file name
# argument) on x86 Linux and finds for each function the function it
# calls. The output is suitable for colibri.

$function=0;

while(defined($line = <>)) {
    if ($line =~ /<([^>]+)>:/) {
        if ($function) {
            printf ";\n";
        }    
        $function = $1;
        printf "%s:\n", $function;
    }
    if ($line =~ /<([^-+>]+)>$/) {
        printf " %s", $1;
    }
}
print ";\n";
